--markdown 支持
--

return {
  -- 代码块高亮
  {
    "tpope/vim-markdown",
    config = function()
      vim.g.markdown_syntax_conceal = 0
      vim.g.markdown_fenced_languages = {
        "html",
        "python",
        "bash=sh",
        "json",
        "java",
        "js=javascript",
        "sql",
        "yaml",
        "xml",
        "Dockerfile",
        "Rust",
        "swift",
        "javascript",
        "lua",
      }
    end
  },
  -- 终端实时渲染
  {
    "yelog/marklive.nvim",
    dependencies = { 'nvim-treesitter/nvim-treesitter' },
    lazy = true,
    ft = "markdown",
    opts = {

    },
  },
  -- 实时预览
  {
    "iamcco/markdown-preview.nvim",
    cmd = {"MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop"},
    ft = {"markdown"},
    build = function()
      vim.fn["mkdp#util#install"]()
      vim.g.mkdp_theme = "light"
    end,
  },

  -- 效率插件
  {
    "bullets-vim/bullets.vim",
    config = function()
      vim.g.bullets_enabled_file_types = {
        "markdown",
        "text",
        "gitcommit",
        "scratch",
      }
    end,
  },
  -- 任务列表
  {
    "tenxsoydev/vim-markdown-checkswitch",
    config = function()
      vim.g.md_checkswitch_style = "cycle"
    end,
  },
  -- 表格
  {
    "dhruvasagar/vim-table-mode",
    config = function()
      vim.cmd([[
        augroup markdown_config
          autocmd!
          autocmd FileType markdown nnoremap <buffer> <M-s> :TableModeRealign<CR>
        augroup END
      ]], false)
      vim.g.table_mode_sort_map = "<leader>mts"
    end,
  },
}
